/**
 * fulihui.com Inc.
 * Copyright (c) 2015-2017 All Rights Reserved.
 */
package com.fulihui.usercore.core.repository.impl;

import com.fulihui.usercore.biz.conv.GeneralConv;
import com.fulihui.usercore.core.repository.WechatUnionidHelpRepository;
import com.fulihui.usercore.dal.dataobj.WechatUnionidHelpDO;
import com.fulihui.usercore.dal.dataobj.WechatUnionidHelpDOExample;
import com.fulihui.usercore.dal.mapper.WechatUnionidHelpDOMapper;
import com.fulihui.usercore.dto.WechatUserDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *  用户授权信息辅助（unionid）仓库  实现
 * @author: zhangyingjie
 * @version: v 0.1 2017年10月24日 15:33  zhangyingjie Exp $
 */
@Repository
public class WechatUnionidHelpRepositoryImpl implements WechatUnionidHelpRepository {
    @Autowired
    private WechatUnionidHelpDOMapper wechatUnionidHelpDOMapper;
    @Override
    public List<WechatUserDTO> query(WechatUnionidHelpDOExample example) {
        return GeneralConv.convert2List(wechatUnionidHelpDOMapper.selectByExample(example),WechatUserDTO.class);
    }

    @Override
    public void create(WechatUserDTO dto) {
        wechatUnionidHelpDOMapper.insert(GeneralConv.conv(dto,WechatUnionidHelpDO.class));
    }
}
